<template>
	<div class="orderInfor-warp" style="margin-top: 0;">
		<!--基本信息-->
		<div class="baseInfor">
			<div class="identity-type">
				<span>基本信息</span>
			</div>
			<div class="essen_list essen_after">
				<p><span>订单编号</span><b>{{content.orderNo}}</b></p>
				<p><span>订单状态</span><b style="color:#fdb96e">{{content.fgOrderStatusLabel}}</b></p>
				<p>异常说明</p>
				<p class="last_p">{{content.exceptionRemarks }}</p>
			</div>
			<div class="essen_list essen_paytype">
				<p><span>支付方式</span><b>{{content.payTypeLabel}}</b></p>
				<p><span>运输方式</span><b> {{content.tranTypeLabel}} </b></p>
				<p>备注 </p>
				<p class="last_p">{{content.remarks}}</p>
			</div>
		</div>
		<!--物料列表-->
		<div class="materInfor">
			<div class="identity-type material-title" v-if='content.orderMaterialList!==null'>
				<span>物料列表</span>
			</div>
			<div class="material-list">
				<ul class="material_list">

					<li v-for='(item,index) in content.orderMaterialList' :key=index>
						<p><span>{{item.materialName}}</span>

						</p>
						<p><span>物料重量</span><b>{{item.weight?item.weight:0}}<em>吨</em></b></p>
						<p><span>物料单价</span><b>{{item.unitPrice}}<em>元/吨</em></b></p>
						<p><span>含杂比例</span><b>{{item.zazhiPercent?item.zazhiPercent:0}}<em>%</em></b></p>
					</li>
				</ul>
				<ol class="material_photo_list">

				</ol>
			</div>
		</div>
		<!--合同扫描件-->
		<div class="contractInfor" v-show='content.fgOrderStatus!=0 && content.fgOrderStatus!=10'>
			<div class="identity-type">
				<span>合同扫描件</span>
			</div>
			<div class="contract-scans">
				<router-link :to="{path:'quotation',query:{orderNo:this.orderNo,status:1}}">
					<p class="quotation">
						<span>报价单</span>
						<img src="../../images/right.png">
					</p>
				</router-link>
				<router-link :to="{path:'signingContract',query:{orderNo:this.orderNo,status:1}}">
					<p class="alreadySigned">
						<span>已签章合同</span>
						<img src="../../images/right.png">
					</p>
				</router-link>
				<a  @click="toOriginalContract">
					<p class="originalContract">
						<span>合同原件</span>
						<img src="../../images/right.png">
					</p>
				</a>
			</div>
		</div>

		<!--过磅入库信息-->
		<div class="ponderationInfor" v-show='content.fgOrderStatus!=20 && content.fgOrderStatus!=0 && content.fgOrderStatus!=10'>
			<div class="identity-type">
				<span>过磅入库信息</span>
				<i class="transInfor" @click="transInforClick(orderNo)">运输车信息</i>
			</div>
			<div class="ponderation-info">
				<div class="ponderation-info-warp info-warp1">
					<p><span>已过磅数量</span><b>{{content.weighCount?content.weighCount:0}}<em>吨</em></b></p>
					<p><span>未过磅数量</span><b>{{content.noWeighCount?content.noWeighCount:0}}<em>吨</em></b></p>
					<p><span>现场扣杂比例</span><b>{{content.realKouzaPercent?content.realKouzaPercent:0}}<em>%</em></b></p>
					<p><span>实际入库数量</span><b>{{content.realEnterCount?content.realEnterCount.toFixed(3):0}}<em>吨</em></b></p>
					<p><span>实际成交金额</span><b>{{content.finishTotalPrice?content.finishTotalPrice:0}}<em>元</em></b></p>
					<p><span>实际入库时间</span><b>{{content.payTimeStr?content.payTimeStr:''}}</b></p>
				</div>

				<div class="contract-scans">
					<router-link :to="{path:'orderPoundlist',query:{orderNo:this.orderNo,status:1}}">
						<p class="outPonder">
							<span>出库磅单</span>
							<img src="../../images/right.png">
						</p>
					</router-link>
					<router-link :to="{path:'ponderationList',query:{orderNo:this.orderNo,status:1}}">
						<p class="initPonder">
							<span>收货磅单</span>
							<img src="../../images/right.png">
						</p>
					</router-link>
					<router-link :to="{path:'transportCompletion',query:{orderNo:this.orderNo,status:1}}">
						<p class="entryInfor">
							<span>确认运输完毕</span>
							<img src="../../images/right.png">
						</p>
					</router-link>
					<router-link :to="{path:'confirmwarehouseReceipt',query:{orderNo:this.orderNo,status:1}}">
						<p class="receipt" style="border: 0;">
							<span>收货单</span>
							<img src="../../images/right.png">
						</p>
					</router-link>
				</div>
			</div>
		</div>

		<!--支付信息-->
		<div class="payInfor" v-show='content.fgOrderStatus!=20 && content.fgOrderStatus!=40 && content.fgOrderStatus!=0 && content.fgOrderStatus!=10'>
			<div class="identity-type">
				<span>支付信息</span>
				<router-link to='/ticketInformation'>
					<i class="ticketInfor" v-show='content.isHanshui!=10'>开票信息</i>
				</router-link>			
			</div>
			<div class="ponderation-info">
				<div class="ponderation-info-warp info-warp2">
					<p><span>应支付金额</span><b>{{content.needPayMoney?content.needPayMoney:0}}<em>元</em></b></p>
					<p><span>已支付金额</span><b>{{content.hadPayMoney?content.hadPayMoney:0}}<em>元</em></b></p>
					<p><span>未支付金额</span><b>{{content.noPayMoney?content.noPayMoney:0}}<em>元</em></b></p>
					<p><span>支付完成时间</span><b>{{content.payTimeStr?content.payTimeStr:''}}</b></p>
				</div>

				<div class="contract-scans">
					<!--<p class="express">
							<span>发票快递单</span>
							<img src="../../img/right.png" />
						</p>-->
					<router-link :to="{path:'bankTicket',query:{orderNo:this.orderNo}}">
						<p class="banks">
							<span>银行回单</span>
							<img src="../../images/right.png">
						</p>
					</router-link>
				</div>
			</div>
		</div>

	</div>
</template>

<script>
	import {
		getFgOrderDetail
	} from '../../config/api'
	import { getOriginFile } from '../../config/api'
	import { imgBaseUrl } from '../../config/axios'
	import {
		TopTips
	} from 'we-vue'
	export default {
		data() {
			return {
				content: '',
				orderNo:'',
				status:1,
				kaipiaoId:''
			}
		},
		mounted() {
			const id = this.$route.query.orderid
			getFgOrderDetail(id).then(res => {
				this.content = res.content
				this.orderNo = res.content.orderNo
				this.kaipiaoId = res.content.kaipiaoId
			})
		},
		methods: {
			toOriginalContract() {
				getOriginFile(this.orderNo).then(res=>{
					if(res.code==100){
						window.location.href = imgBaseUrl+res.content
					}else{
						TopTips({
						  message: res.content,
						  duration: 1200
						})
					}
				}).catch(err=>console.log(err))
			},
			transInforClick(orderNo){
				this.$router.push({
					path:"orderTransport",
					query:{
						orderNo:orderNo,
						status:1
					}
				})
			}
		}
		
	}
</script>

<style>
</style>
